<template>
	<view class="two-col-list rbox_wrap">
		<view class="item cbox" v-for="(item, idx) in list" :key="idx" @tap="goPage">
			<view :class="['img-wrap', itemHeight]"></view>
			<text class="name ellips">{{item.name ? item.name : ''}}</text>
			<text class="sub ellips">{{item.sub ? item.sub : ''}}</text>
		</view>
	</view>
</template>

<script>
	export default {
		props: {
			list: {
				type: Array,
				default: []
			},
			pageName: {
				type: String,
				default: ''
			},
			itemHeight: {
				type: String,
				default: 'normal'
			}
		},
		data() {
			return {
				
			};
		},
		methods: {
			goPage() {
				let pageName = this.pageName
				if (pageName) {					
					wx.navigateTo({
						url: `/pages/${pageName}/${pageName}`
					})
				}
			}
		},
		computed: {
		}
	}
</script>

<style lang="scss">
.two-col-list {
	padding: 0 42rpx;
	margin-top: 20rpx;
	.item {
		margin-bottom: 20rpx;
		&:nth-of-type(2n) {
			margin-left: 26rpx;
		}
		.img-wrap {
			width: 320rpx;
			background: #DBC2C2;
			border-radius: 20rpx;
			&.normal {
			  height: 272rpx;
			}
			&.small {
				height: 200rpx;
			}
		}
		.name {
			margin-top: 20rpx;
			font-size: 28rpx;
			line-height: 1;
			color: #656565;
		}
		.sub {
			margin-top: 10rpx;
			font-size: 22rpx;
			line-height: 1;
			color: #B4B4B4;
		}
	}
}
</style>
